package top.gelonggld.model;

import top.gelonggld.constants.Rex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by gelon on 2017/7/20.
 */
public class Propty extends Paragraph{
    String proType,   //属性类型
            proValue, //属性值
            proBody, //属性代码部分
            proIndent; //属性缩进






    private void parseBody() {
        for (OutAnno oa : outAnnos){
            Pattern pattern = Pattern.compile(Rex.PROPERTY);
            Matcher matcher = pattern.matcher(oa.paragraphStr);
            if(matcher.find()){
                proBody = matcher.group();
                proIndent = matcher.group(1);
                bodyHead = matcher.start();
                bodyend = matcher.end();
                proType = matcher.group(9);
                proValue = matcher.group(10);
            }
        }
    }

    public Propty(int start, int end, String paragraphStr, int type) {
        super(start,end,paragraphStr,type);
    }



    @Override
    public void onPushDate(String paragraphStr) {
        super.onPushDate(paragraphStr);
        parseBody();
    }



    public String getProType() {
        return proType;
    }

    public String getProValue() {
        return proValue;
    }

    public String getProBody() {
        return proBody;
    }

    public String getProIndent() {
        return proIndent;
    }

}
